package com.jdzy.student.controller;

import com.jdzy.model.common.vos.ResultA;
import com.jdzy.model.common.vos.ResultCodeEnum;
import com.jdzy.model.teacher.dtos.AssginRoleDto;
import com.jdzy.student.service.SysRoleUserService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@Slf4j
@Api(value = "角色用户的controller类")
@CrossOrigin(allowCredentials = "true" , allowedHeaders = "*")
@RequestMapping(value = "/api/system/sysRoleUser")
public class SysRoleUserController {
    @Autowired
    private SysRoleUserService sysRoleUserService ;
    //	分配角色
    //先删除，再添加
    @PostMapping("/doAssign")
    public ResultA doAssign(@RequestBody AssginRoleDto assginRoleDto) {
        sysRoleUserService.doAssign(assginRoleDto) ;
        return ResultA.build(null , ResultCodeEnum.SUCCESS) ;
    }
}
